import os
import json
from idlelib.iomenu import encoding

# 文件路径配置
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
print(BASE_DIR)

# url配置
URL = "http://kapi.ksit.kaikela.cn/api.do"
URL_xhx_login = "http://xhx.xsit.kaikela.cn/passport/gettoken"
URL_GO = "http://xhx.xsit.kaikela.cn/goproxy"
SSO_GO = "https://xhx.xsit.kaikela.cn/ssogoproxy"
URL_xhx = "http://xhx.xsit.kaikela.cn"

# 链接数据库：estudy_db; kaikela_mem; kaikela_support; bigdata; estudy_cpcore; estudy_recruit; estudy_class; wechat;
SQL_data = ["10.0.0.233",3502,"xhx_user","A654321","bigdata"]



# # 读取 config 文件内容
# def load_config():
#     with open(os.path.join(BASE_DIR+"/data/", 'config.json'), 'r', encoding='utf-8') as f:
#         return json.load(f)
#
# # 写入 config 文件内容
# def save_config(config_data):
#     with open(os.path.join(BASE_DIR+"/data/", 'config.json'), 'w', encoding='utf-8') as f:
#         json.dump(config_data, f, indent=4)

class Token:
    token = ""
    xhxtoken = "xhxtoken=m0005143_bac8e039e7a1122b79f49b8696e586ae407"

    TOKEN_RESULT = [
        {"token":"T7KyphQsAtLXEKaqNOUg1ZodfFRRL1ggQvXXwLefZdQJ3stWcXvRISnQ3MLa-002",
         "xhx_token":{"xhxtoken":"m0005267_588404058b958935d5ddd9a38c0e476a126"}}
    ]

class Variable:
    variable = "111"



# 打印请求信息
def prints(response):
    print(f"Request URL: {response.request.url}")
    print(f"Request URL: {response.status_code}")
    print(f"Request Headers: {response.request.headers}")
    print(f"Request Body: {response.request.body}")
    # print(f"Request Body: {response.request.body.decode('utf-8')}")
    print("-"*50)
